﻿#region File Description

//-----------------------------------------------------------------------------
// MagicJSON.cs
//
// Author: ITU Team3 (2012)
//-----------------------------------------------------------------------------

#endregion File Description

using System.Web.Script.Serialization;

namespace rentit03_client
{
    public static class MagicJSON
    {
        private static readonly JavaScriptSerializer Serializer = new JavaScriptSerializer();

        public static T Deserialize<T>(string json)
        {
            return (new JavaScriptSerializer()).Deserialize<T>(json);
        }

        public static string ToJSON(this object obj)
        {
            return Serializer.Serialize(obj);
        }
    }
}